Find the length of a SetΒΆ

len(S)

Find the length of a Set.
# Create a set
S1 = set([5, 10, 3, 15, 2, 20])

# Find the length use len()
print(len(S1))                                 # 6